package tree;

public class MyBinaryTree<T1,T2> {
    MyBinaryTreeNode<T1,T2> root;

    public void add(T1 id,T2 element){
        MyBinaryTreeNode<T1,T2> node = new MyBinaryTreeNode<T1,T2>(id,element);
        if (root==null){
            root=node;
        }else {
            root.add(node,null);
        }
    }
    public void preOrderPrint(){
        if(root==null){
            return;
        }
        root.preOrderPrint();
    }

    public T2 search(T1 id){
        if(root==null){
            return null;
        }
        return root.search(id);
    }
}
